#include "stdafx.h"
#include "queue.h"
#include "object.h"
#include "timer.h"
#include "message.h"
#include "master.h"
#include "hero.h"
#include "display.h"

#include "Array3D.h"
#include "matrix.h"

#include "terminator.h"
// for memory leaks finding
#include <debug_new.h>
//



int main(int argc, char* argv[])
{
	int xsize = 3;
	int ysize = 3;
	int zsize = 3;

	CArray3D* cube = new CArray3D(3,3,3);

	for(int k=0; k < zsize; k++)
		for(int j=0; j < ysize; j++)
			for(int i=0; i < xsize; i++)
				(*cube)(i,j,k)=i+k;

	CArray3D* rotatedCube = new CArray3D(zsize, ysize, xsize);
	for(int i=0; i < xsize; i++)
		for(int j=0; j < ysize; j++)
			for(int k=0; k < zsize; k++)
					(*rotatedCube)(j, xsize-i-1, k) = (*cube)(i,j,k);

	for(int k=0; k < zsize; k++)
	{
		for(int j=ysize-1; j>=0; j--)
		{
			for(int i=0; i < xsize; i++)
				cout << (*cube)(i,j,k) << " ";
			
			cout << endl;
		}
		cout << endl << endl;
	}


	for(int k=0; k < zsize; k++)
	{
		for(int j=ysize-1; j>=0; j--)
		{
			for(int i=0; i < xsize; i++)
				cout << (*rotatedCube)(i,j,k) << " ";
			
			cout << endl;
		}
		cout << endl << endl;
	}

	delete cube;
	delete rotatedCube;

	return 0;
}